Image matting refers to pixel estimation in images and video based on foreground and background image information. The matte defines which pixels are foreground, which are background. For pixels along the boundary or in semi-transparent regions such as hair, the matte defines the mixture of foreground and background at each pixel. Mathematically, image matting requires expressing pixel colors in the transition regions from foreground to background using a convex combination of their underlying foreground and background colors that formed the mixed-color pixel. The weight, or the opacity, of the foreground color is typically referred to as the alpha value of the pixel. Extracting the opacity information of foreground objects from an image is known as natural image matting.
The numerous natural matting methods in the literature can be mainly categorized as either sampling-based or affinity-based. Sampling-based methods typically propose a way of gathering numerous samples from the background and foreground regions defined by a trimap, and select the best-fitting pair according to their individually defined criteria to represent an unknown pixel as a mixture of foreground and background.
Affinity-based matting methods mainly make use of the pixel-similarity metrics that rely on color similarity or spatial proximity, and propagate the alpha values from regions with known opacity. Local affinity definitions look at a local patch around the pixel location to 20 determine the amount of local information flow, and propagate alpha values accordingly. The matting affinity is also widely adopted as a post-processing step in sampling-based methods. Methods utilizing non-local affinities also use color information in addition to spatial proximity for determining how the alpha values of different pixels should relate to each other.
There is also hybrid approach that uses the sampling-based robust matting as a starting point, and refines its outcome through a graph-based technique where they combine a non-local affinity and the local affinity.